package com.jt.www.model.vo;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * 补录前端回参vo
 * Created by shaoyn on 2019/10/10.
 */

public class PostRecordedVo {
    /**
     * 总条数
     */
    private int total;
    /**
     * 成功条数
     */
    private int successTotal;
    /**
     * 失败条数
     */
    private int errorTotal;
    /**
     * 补录失败的投保单号
     */
    private List<String> processErrorList;
    /**
     * 解析出错信息
     */
    private List<String> parserErrorMsgList;

    public PostRecordedVo() {
        total = 0;
        successTotal = 0;
        errorTotal = 0;
        processErrorList = Lists.newArrayList();
        parserErrorMsgList = Lists.newArrayList();
    }

    public void addParserErrorMsg(String errorMsg) {
        parserErrorMsgList.add(errorMsg);
    }

    /**
     * 添加出错的投保单号
     *
     * @param errorAppCode
     */
    public synchronized void addProcessError(String errorAppCode) {
        total++;
        errorTotal++;
        processErrorList.add(errorAppCode);
    }


    /**
     * 成功后添加
     */
    public synchronized void addSuccess() {
        total++;
        successTotal++;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSuccessTotal() {
        return successTotal;
    }

    public void setSuccessTotal(int successTotal) {
        this.successTotal = successTotal;
    }

    public int getErrorTotal() {
        return errorTotal;
    }

    public void setErrorTotal(int errorTotal) {
        this.errorTotal = errorTotal;
    }

    public List<String> getProcessErrorList() {
        return processErrorList;
    }

    public void setProcessErrorList(List<String> processErrorList) {
        this.processErrorList = processErrorList;
    }

    public List<String> getParserErrorMsgList() {
        return parserErrorMsgList;
    }

    public void setParserErrorMsgList(List<String> parserErrorMsgList) {
        this.parserErrorMsgList = parserErrorMsgList;
    }
}
